﻿@model IEnumerable<Vacation.Models.Course>
<h2>@ViewBag.Title</h2>
<p>
    @Html.ActionLink("新建条目", "Create",new{type=Request.QueryString["type"]})
</p>
@using (Html.BeginForm())
{
    <p>
        课号: @Html.TextBox("CourseNo","%")  课名：@Html.TextBox("Name","%") 学院： @Html.DropDownList("School")
        <input type="submit" value="查找" /></p>
}
<table class="infolist">
    <tr style="text-align:center">
        <th></th>
        <th>
            课号
        </th>
        <th>
            课名
        </th>
        <th>
            类型
        </th>
        <th>
            开设学院
        </th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td >
            @Html.ActionLink("编辑", "Edit", new { courseno=item.CourseNo }) |
            @Html.ActionLink("详情", "Details", new { courseno=item.CourseNo }) |
            @Html.ActionLink("成绩", "Score", new { courseno=item.CourseNo })
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.CourseNo)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Name)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Type)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.School)
        </td>
    </tr>
}
</table>
<div class="paged">   
    @Html.ActionLink("首页", "Index", new { page = 1, courseno = ViewBag.CourseNo,name=ViewBag.Name,school=ViewBag.SchoolCode,type=ViewBag.coursetype })
    @Html.Raw(" ")
    @Html.ActionLink("上页", "Index", new { page = ViewBag.LastPage, courseno = ViewBag.CourseNo, name = ViewBag.Name, school = ViewBag.SchoolCode, type = ViewBag.coursetype })
    @Html.Raw(" ")
    @Html.ActionLink("下页", "Index", new { page = ViewBag.NextPage, courseno = ViewBag.CourseNo, name = ViewBag.Name, school = ViewBag.SchoolCode, type = ViewBag.coursetype })
    @Html.Raw(" ")
    @Html.ActionLink("尾页", "Index", new { page = ViewBag.EndPage, courseno = ViewBag.CourseNo, name = ViewBag.Name, school = ViewBag.SchoolCode, type = ViewBag.coursetype })
    @Html.Raw(" 第"+ViewBag.CurrPag+"页 共"+ViewBag.PageCount+"页 共找到"+ViewBag.RecordCount+"条记录 每页"+ViewBag.PageSize+"条")
</div>
<div>
<p>注：本人只能对自己学院的课程添加学生成绩。</p>

</div>
